int width, height;
int stride, i;
guchar *mem_surface, *data;
+ GVariant *result;
width = cairo_image_surface_get_width (self->surface);
height = cairo_image_surface_get_height (self->surface);
for (i = 0; i < height; i++)
memcpy (mem_surface + i * width * 4, data + i * stride, width * 4);
- return g_variant_new ("(dddduu@au)",
- (double) node->bounds.origin.x, (double) node->bounds.origin.y,
- (double) node->bounds.size.width, (double) node->bounds.size.height,
- (guint32) width,
- (guint32) height,
- g_variant_new_fixed_array (G_VARIANT_TYPE ("u"),
- mem_surface,
- width * height,
- sizeof (guint32)));
-
+ result = g_variant_new ("(dddduu@au)",
+ (double) node->bounds.origin.x, (double) node->bounds.origin.y,
+ (double) node->bounds.size.width, (double) node->bounds.size.height,
+ (guint32) width,
+ (guint32) height,
+ g_variant_new_fixed_array (G_VARIANT_TYPE ("u"),
+ mem_surface,
+ width * height,
+ sizeof (guint32)));
g_free (mem_surface);
+
+ return result;
}
}